Left Termination of the query pattern query(b) w.r.t. the given Prolog program could successfully be proven:



PROLOG
  ↳ PrologToPiTRSProof

append3(nil0, XS, XS).
append3(cons2(X, XS), YS, cons2(X, ZS)) :- append3(XS, YS, ZS).
reverse2(nil0, nil0).
reverse2(cons2(X, nil0), cons2(X, nil0)).
reverse2(cons2(X, XS), YS) :- reverse2(XS, ZS), append3(ZS, cons2(X, nil0), YS).
shuffle2(nil0, nil0).
shuffle2(cons2(X, XS), cons2(X, YS)) :- reverse2(XS, ZS), shuffle2(ZS, YS).
query1(XS) :- shuffle2(cons2(X, XS), YS).


With regard to the inferred argument filtering the predicates were used in the following modes:
query1: (b)
shuffle2: (b,f)
reverse2: (b,f)
append3: (b,b,f)
Transforming PROLOG into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:


query_1_in_g1(XS) -> if_query_1_in_1_g2(XS, shuffle_2_in_ga2(cons_22(X, XS), YS))
shuffle_2_in_ga2(nil_0, nil_0) -> shuffle_2_out_ga2(nil_0, nil_0)
shuffle_2_in_ga2(cons_22(X, XS), cons_22(X, YS)) -> if_shuffle_2_in_1_ga4(X, XS, YS, reverse_2_in_ga2(XS, ZS))
reverse_2_in_ga2(nil_0, nil_0) -> reverse_2_out_ga2(nil_0, nil_0)
reverse_2_in_ga2(cons_22(X, nil_0), cons_22(X, nil_0)) -> reverse_2_out_ga2(cons_22(X, nil_0), cons_22(X, nil_0))
reverse_2_in_ga2(cons_22(X, XS), YS) -> if_reverse_2_in_1_ga4(X, XS, YS, reverse_2_in_ga2(XS, ZS))
if_reverse_2_in_1_ga4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> if_reverse_2_in_2_ga5(X, XS, YS, ZS, append_3_in_gga3(ZS, cons_22(X, nil_0), YS))
append_3_in_gga3(nil_0, XS, XS) -> append_3_out_gga3(nil_0, XS, XS)
append_3_in_gga3(cons_22(X, XS), YS, cons_22(X, ZS)) -> if_append_3_in_1_gga5(X, XS, YS, ZS, append_3_in_gga3(XS, YS, ZS))
if_append_3_in_1_gga5(X, XS, YS, ZS, append_3_out_gga3(XS, YS, ZS)) -> append_3_out_gga3(cons_22(X, XS), YS, cons_22(X, ZS))
if_reverse_2_in_2_ga5(X, XS, YS, ZS, append_3_out_gga3(ZS, cons_22(X, nil_0), YS)) -> reverse_2_out_ga2(cons_22(X, XS), YS)
if_shuffle_2_in_1_ga4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> if_shuffle_2_in_2_ga5(X, XS, YS, ZS, shuffle_2_in_ga2(ZS, YS))
if_shuffle_2_in_2_ga5(X, XS, YS, ZS, shuffle_2_out_ga2(ZS, YS)) -> shuffle_2_out_ga2(cons_22(X, XS), cons_22(X, YS))
if_query_1_in_1_g2(XS, shuffle_2_out_ga2(cons_22(X, XS), YS)) -> query_1_out_g1(XS)

The argument filtering Pi contains the following mapping:
query_1_in_g1(x1)  =  query_1_in_g1(x1)
nil_0  =  nil_0
cons_22(x1, x2)  =  cons_21(x2)
if_query_1_in_1_g2(x1, x2)  =  if_query_1_in_1_g1(x2)
shuffle_2_in_ga2(x1, x2)  =  shuffle_2_in_ga1(x1)
shuffle_2_out_ga2(x1, x2)  =  shuffle_2_out_ga1(x2)
if_shuffle_2_in_1_ga4(x1, x2, x3, x4)  =  if_shuffle_2_in_1_ga1(x4)
reverse_2_in_ga2(x1, x2)  =  reverse_2_in_ga1(x1)
reverse_2_out_ga2(x1, x2)  =  reverse_2_out_ga1(x2)
if_reverse_2_in_1_ga4(x1, x2, x3, x4)  =  if_reverse_2_in_1_ga1(x4)
if_reverse_2_in_2_ga5(x1, x2, x3, x4, x5)  =  if_reverse_2_in_2_ga1(x5)
append_3_in_gga3(x1, x2, x3)  =  append_3_in_gga2(x1, x2)
append_3_out_gga3(x1, x2, x3)  =  append_3_out_gga1(x3)
if_append_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_append_3_in_1_gga1(x5)
if_shuffle_2_in_2_ga5(x1, x2, x3, x4, x5)  =  if_shuffle_2_in_2_ga1(x5)
query_1_out_g1(x1)  =  query_1_out_g

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of PROLOG



↳ PROLOG
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

query_1_in_g1(XS) -> if_query_1_in_1_g2(XS, shuffle_2_in_ga2(cons_22(X, XS), YS))
shuffle_2_in_ga2(nil_0, nil_0) -> shuffle_2_out_ga2(nil_0, nil_0)
shuffle_2_in_ga2(cons_22(X, XS), cons_22(X, YS)) -> if_shuffle_2_in_1_ga4(X, XS, YS, reverse_2_in_ga2(XS, ZS))
reverse_2_in_ga2(nil_0, nil_0) -> reverse_2_out_ga2(nil_0, nil_0)
reverse_2_in_ga2(cons_22(X, nil_0), cons_22(X, nil_0)) -> reverse_2_out_ga2(cons_22(X, nil_0), cons_22(X, nil_0))
reverse_2_in_ga2(cons_22(X, XS), YS) -> if_reverse_2_in_1_ga4(X, XS, YS, reverse_2_in_ga2(XS, ZS))
if_reverse_2_in_1_ga4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> if_reverse_2_in_2_ga5(X, XS, YS, ZS, append_3_in_gga3(ZS, cons_22(X, nil_0), YS))
append_3_in_gga3(nil_0, XS, XS) -> append_3_out_gga3(nil_0, XS, XS)
append_3_in_gga3(cons_22(X, XS), YS, cons_22(X, ZS)) -> if_append_3_in_1_gga5(X, XS, YS, ZS, append_3_in_gga3(XS, YS, ZS))
if_append_3_in_1_gga5(X, XS, YS, ZS, append_3_out_gga3(XS, YS, ZS)) -> append_3_out_gga3(cons_22(X, XS), YS, cons_22(X, ZS))
if_reverse_2_in_2_ga5(X, XS, YS, ZS, append_3_out_gga3(ZS, cons_22(X, nil_0), YS)) -> reverse_2_out_ga2(cons_22(X, XS), YS)
if_shuffle_2_in_1_ga4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> if_shuffle_2_in_2_ga5(X, XS, YS, ZS, shuffle_2_in_ga2(ZS, YS))
if_shuffle_2_in_2_ga5(X, XS, YS, ZS, shuffle_2_out_ga2(ZS, YS)) -> shuffle_2_out_ga2(cons_22(X, XS), cons_22(X, YS))
if_query_1_in_1_g2(XS, shuffle_2_out_ga2(cons_22(X, XS), YS)) -> query_1_out_g1(XS)

The argument filtering Pi contains the following mapping:
query_1_in_g1(x1)  =  query_1_in_g1(x1)
nil_0  =  nil_0
cons_22(x1, x2)  =  cons_21(x2)
if_query_1_in_1_g2(x1, x2)  =  if_query_1_in_1_g1(x2)
shuffle_2_in_ga2(x1, x2)  =  shuffle_2_in_ga1(x1)
shuffle_2_out_ga2(x1, x2)  =  shuffle_2_out_ga1(x2)
if_shuffle_2_in_1_ga4(x1, x2, x3, x4)  =  if_shuffle_2_in_1_ga1(x4)
reverse_2_in_ga2(x1, x2)  =  reverse_2_in_ga1(x1)
reverse_2_out_ga2(x1, x2)  =  reverse_2_out_ga1(x2)
if_reverse_2_in_1_ga4(x1, x2, x3, x4)  =  if_reverse_2_in_1_ga1(x4)
if_reverse_2_in_2_ga5(x1, x2, x3, x4, x5)  =  if_reverse_2_in_2_ga1(x5)
append_3_in_gga3(x1, x2, x3)  =  append_3_in_gga2(x1, x2)
append_3_out_gga3(x1, x2, x3)  =  append_3_out_gga1(x3)
if_append_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_append_3_in_1_gga1(x5)
if_shuffle_2_in_2_ga5(x1, x2, x3, x4, x5)  =  if_shuffle_2_in_2_ga1(x5)
query_1_out_g1(x1)  =  query_1_out_g


Pi DP problem:
The TRS P consists of the following rules:

QUERY_1_IN_G1(XS) -> IF_QUERY_1_IN_1_G2(XS, shuffle_2_in_ga2(cons_22(X, XS), YS))
QUERY_1_IN_G1(XS) -> SHUFFLE_2_IN_GA2(cons_22(X, XS), YS)
SHUFFLE_2_IN_GA2(cons_22(X, XS), cons_22(X, YS)) -> IF_SHUFFLE_2_IN_1_GA4(X, XS, YS, reverse_2_in_ga2(XS, ZS))
SHUFFLE_2_IN_GA2(cons_22(X, XS), cons_22(X, YS)) -> REVERSE_2_IN_GA2(XS, ZS)
REVERSE_2_IN_GA2(cons_22(X, XS), YS) -> IF_REVERSE_2_IN_1_GA4(X, XS, YS, reverse_2_in_ga2(XS, ZS))
REVERSE_2_IN_GA2(cons_22(X, XS), YS) -> REVERSE_2_IN_GA2(XS, ZS)
IF_REVERSE_2_IN_1_GA4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> IF_REVERSE_2_IN_2_GA5(X, XS, YS, ZS, append_3_in_gga3(ZS, cons_22(X, nil_0), YS))
IF_REVERSE_2_IN_1_GA4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> APPEND_3_IN_GGA3(ZS, cons_22(X, nil_0), YS)
APPEND_3_IN_GGA3(cons_22(X, XS), YS, cons_22(X, ZS)) -> IF_APPEND_3_IN_1_GGA5(X, XS, YS, ZS, append_3_in_gga3(XS, YS, ZS))
APPEND_3_IN_GGA3(cons_22(X, XS), YS, cons_22(X, ZS)) -> APPEND_3_IN_GGA3(XS, YS, ZS)
IF_SHUFFLE_2_IN_1_GA4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> IF_SHUFFLE_2_IN_2_GA5(X, XS, YS, ZS, shuffle_2_in_ga2(ZS, YS))
IF_SHUFFLE_2_IN_1_GA4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> SHUFFLE_2_IN_GA2(ZS, YS)

The TRS R consists of the following rules:

query_1_in_g1(XS) -> if_query_1_in_1_g2(XS, shuffle_2_in_ga2(cons_22(X, XS), YS))
shuffle_2_in_ga2(nil_0, nil_0) -> shuffle_2_out_ga2(nil_0, nil_0)
shuffle_2_in_ga2(cons_22(X, XS), cons_22(X, YS)) -> if_shuffle_2_in_1_ga4(X, XS, YS, reverse_2_in_ga2(XS, ZS))
reverse_2_in_ga2(nil_0, nil_0) -> reverse_2_out_ga2(nil_0, nil_0)
reverse_2_in_ga2(cons_22(X, nil_0), cons_22(X, nil_0)) -> reverse_2_out_ga2(cons_22(X, nil_0), cons_22(X, nil_0))
reverse_2_in_ga2(cons_22(X, XS), YS) -> if_reverse_2_in_1_ga4(X, XS, YS, reverse_2_in_ga2(XS, ZS))
if_reverse_2_in_1_ga4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> if_reverse_2_in_2_ga5(X, XS, YS, ZS, append_3_in_gga3(ZS, cons_22(X, nil_0), YS))
append_3_in_gga3(nil_0, XS, XS) -> append_3_out_gga3(nil_0, XS, XS)
append_3_in_gga3(cons_22(X, XS), YS, cons_22(X, ZS)) -> if_append_3_in_1_gga5(X, XS, YS, ZS, append_3_in_gga3(XS, YS, ZS))
if_append_3_in_1_gga5(X, XS, YS, ZS, append_3_out_gga3(XS, YS, ZS)) -> append_3_out_gga3(cons_22(X, XS), YS, cons_22(X, ZS))
if_reverse_2_in_2_ga5(X, XS, YS, ZS, append_3_out_gga3(ZS, cons_22(X, nil_0), YS)) -> reverse_2_out_ga2(cons_22(X, XS), YS)
if_shuffle_2_in_1_ga4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> if_shuffle_2_in_2_ga5(X, XS, YS, ZS, shuffle_2_in_ga2(ZS, YS))
if_shuffle_2_in_2_ga5(X, XS, YS, ZS, shuffle_2_out_ga2(ZS, YS)) -> shuffle_2_out_ga2(cons_22(X, XS), cons_22(X, YS))
if_query_1_in_1_g2(XS, shuffle_2_out_ga2(cons_22(X, XS), YS)) -> query_1_out_g1(XS)

The argument filtering Pi contains the following mapping:
query_1_in_g1(x1)  =  query_1_in_g1(x1)
nil_0  =  nil_0
cons_22(x1, x2)  =  cons_21(x2)
if_query_1_in_1_g2(x1, x2)  =  if_query_1_in_1_g1(x2)
shuffle_2_in_ga2(x1, x2)  =  shuffle_2_in_ga1(x1)
shuffle_2_out_ga2(x1, x2)  =  shuffle_2_out_ga1(x2)
if_shuffle_2_in_1_ga4(x1, x2, x3, x4)  =  if_shuffle_2_in_1_ga1(x4)
reverse_2_in_ga2(x1, x2)  =  reverse_2_in_ga1(x1)
reverse_2_out_ga2(x1, x2)  =  reverse_2_out_ga1(x2)
if_reverse_2_in_1_ga4(x1, x2, x3, x4)  =  if_reverse_2_in_1_ga1(x4)
if_reverse_2_in_2_ga5(x1, x2, x3, x4, x5)  =  if_reverse_2_in_2_ga1(x5)
append_3_in_gga3(x1, x2, x3)  =  append_3_in_gga2(x1, x2)
append_3_out_gga3(x1, x2, x3)  =  append_3_out_gga1(x3)
if_append_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_append_3_in_1_gga1(x5)
if_shuffle_2_in_2_ga5(x1, x2, x3, x4, x5)  =  if_shuffle_2_in_2_ga1(x5)
query_1_out_g1(x1)  =  query_1_out_g
IF_SHUFFLE_2_IN_2_GA5(x1, x2, x3, x4, x5)  =  IF_SHUFFLE_2_IN_2_GA1(x5)
IF_QUERY_1_IN_1_G2(x1, x2)  =  IF_QUERY_1_IN_1_G1(x2)
IF_APPEND_3_IN_1_GGA5(x1, x2, x3, x4, x5)  =  IF_APPEND_3_IN_1_GGA1(x5)
SHUFFLE_2_IN_GA2(x1, x2)  =  SHUFFLE_2_IN_GA1(x1)
IF_SHUFFLE_2_IN_1_GA4(x1, x2, x3, x4)  =  IF_SHUFFLE_2_IN_1_GA1(x4)
REVERSE_2_IN_GA2(x1, x2)  =  REVERSE_2_IN_GA1(x1)
IF_REVERSE_2_IN_2_GA5(x1, x2, x3, x4, x5)  =  IF_REVERSE_2_IN_2_GA1(x5)
QUERY_1_IN_G1(x1)  =  QUERY_1_IN_G1(x1)
APPEND_3_IN_GGA3(x1, x2, x3)  =  APPEND_3_IN_GGA2(x1, x2)
IF_REVERSE_2_IN_1_GA4(x1, x2, x3, x4)  =  IF_REVERSE_2_IN_1_GA1(x4)

We have to consider all (P,R,Pi)-chains

↳ PROLOG
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

QUERY_1_IN_G1(XS) -> IF_QUERY_1_IN_1_G2(XS, shuffle_2_in_ga2(cons_22(X, XS), YS))
QUERY_1_IN_G1(XS) -> SHUFFLE_2_IN_GA2(cons_22(X, XS), YS)
SHUFFLE_2_IN_GA2(cons_22(X, XS), cons_22(X, YS)) -> IF_SHUFFLE_2_IN_1_GA4(X, XS, YS, reverse_2_in_ga2(XS, ZS))
SHUFFLE_2_IN_GA2(cons_22(X, XS), cons_22(X, YS)) -> REVERSE_2_IN_GA2(XS, ZS)
REVERSE_2_IN_GA2(cons_22(X, XS), YS) -> IF_REVERSE_2_IN_1_GA4(X, XS, YS, reverse_2_in_ga2(XS, ZS))
REVERSE_2_IN_GA2(cons_22(X, XS), YS) -> REVERSE_2_IN_GA2(XS, ZS)
IF_REVERSE_2_IN_1_GA4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> IF_REVERSE_2_IN_2_GA5(X, XS, YS, ZS, append_3_in_gga3(ZS, cons_22(X, nil_0), YS))
IF_REVERSE_2_IN_1_GA4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> APPEND_3_IN_GGA3(ZS, cons_22(X, nil_0), YS)
APPEND_3_IN_GGA3(cons_22(X, XS), YS, cons_22(X, ZS)) -> IF_APPEND_3_IN_1_GGA5(X, XS, YS, ZS, append_3_in_gga3(XS, YS, ZS))
APPEND_3_IN_GGA3(cons_22(X, XS), YS, cons_22(X, ZS)) -> APPEND_3_IN_GGA3(XS, YS, ZS)
IF_SHUFFLE_2_IN_1_GA4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> IF_SHUFFLE_2_IN_2_GA5(X, XS, YS, ZS, shuffle_2_in_ga2(ZS, YS))
IF_SHUFFLE_2_IN_1_GA4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> SHUFFLE_2_IN_GA2(ZS, YS)

The TRS R consists of the following rules:

query_1_in_g1(XS) -> if_query_1_in_1_g2(XS, shuffle_2_in_ga2(cons_22(X, XS), YS))
shuffle_2_in_ga2(nil_0, nil_0) -> shuffle_2_out_ga2(nil_0, nil_0)
shuffle_2_in_ga2(cons_22(X, XS), cons_22(X, YS)) -> if_shuffle_2_in_1_ga4(X, XS, YS, reverse_2_in_ga2(XS, ZS))
reverse_2_in_ga2(nil_0, nil_0) -> reverse_2_out_ga2(nil_0, nil_0)
reverse_2_in_ga2(cons_22(X, nil_0), cons_22(X, nil_0)) -> reverse_2_out_ga2(cons_22(X, nil_0), cons_22(X, nil_0))
reverse_2_in_ga2(cons_22(X, XS), YS) -> if_reverse_2_in_1_ga4(X, XS, YS, reverse_2_in_ga2(XS, ZS))
if_reverse_2_in_1_ga4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> if_reverse_2_in_2_ga5(X, XS, YS, ZS, append_3_in_gga3(ZS, cons_22(X, nil_0), YS))
append_3_in_gga3(nil_0, XS, XS) -> append_3_out_gga3(nil_0, XS, XS)
append_3_in_gga3(cons_22(X, XS), YS, cons_22(X, ZS)) -> if_append_3_in_1_gga5(X, XS, YS, ZS, append_3_in_gga3(XS, YS, ZS))
if_append_3_in_1_gga5(X, XS, YS, ZS, append_3_out_gga3(XS, YS, ZS)) -> append_3_out_gga3(cons_22(X, XS), YS, cons_22(X, ZS))
if_reverse_2_in_2_ga5(X, XS, YS, ZS, append_3_out_gga3(ZS, cons_22(X, nil_0), YS)) -> reverse_2_out_ga2(cons_22(X, XS), YS)
if_shuffle_2_in_1_ga4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> if_shuffle_2_in_2_ga5(X, XS, YS, ZS, shuffle_2_in_ga2(ZS, YS))
if_shuffle_2_in_2_ga5(X, XS, YS, ZS, shuffle_2_out_ga2(ZS, YS)) -> shuffle_2_out_ga2(cons_22(X, XS), cons_22(X, YS))
if_query_1_in_1_g2(XS, shuffle_2_out_ga2(cons_22(X, XS), YS)) -> query_1_out_g1(XS)

The argument filtering Pi contains the following mapping:
query_1_in_g1(x1)  =  query_1_in_g1(x1)
nil_0  =  nil_0
cons_22(x1, x2)  =  cons_21(x2)
if_query_1_in_1_g2(x1, x2)  =  if_query_1_in_1_g1(x2)
shuffle_2_in_ga2(x1, x2)  =  shuffle_2_in_ga1(x1)
shuffle_2_out_ga2(x1, x2)  =  shuffle_2_out_ga1(x2)
if_shuffle_2_in_1_ga4(x1, x2, x3, x4)  =  if_shuffle_2_in_1_ga1(x4)
reverse_2_in_ga2(x1, x2)  =  reverse_2_in_ga1(x1)
reverse_2_out_ga2(x1, x2)  =  reverse_2_out_ga1(x2)
if_reverse_2_in_1_ga4(x1, x2, x3, x4)  =  if_reverse_2_in_1_ga1(x4)
if_reverse_2_in_2_ga5(x1, x2, x3, x4, x5)  =  if_reverse_2_in_2_ga1(x5)
append_3_in_gga3(x1, x2, x3)  =  append_3_in_gga2(x1, x2)
append_3_out_gga3(x1, x2, x3)  =  append_3_out_gga1(x3)
if_append_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_append_3_in_1_gga1(x5)
if_shuffle_2_in_2_ga5(x1, x2, x3, x4, x5)  =  if_shuffle_2_in_2_ga1(x5)
query_1_out_g1(x1)  =  query_1_out_g
IF_SHUFFLE_2_IN_2_GA5(x1, x2, x3, x4, x5)  =  IF_SHUFFLE_2_IN_2_GA1(x5)
IF_QUERY_1_IN_1_G2(x1, x2)  =  IF_QUERY_1_IN_1_G1(x2)
IF_APPEND_3_IN_1_GGA5(x1, x2, x3, x4, x5)  =  IF_APPEND_3_IN_1_GGA1(x5)
SHUFFLE_2_IN_GA2(x1, x2)  =  SHUFFLE_2_IN_GA1(x1)
IF_SHUFFLE_2_IN_1_GA4(x1, x2, x3, x4)  =  IF_SHUFFLE_2_IN_1_GA1(x4)
REVERSE_2_IN_GA2(x1, x2)  =  REVERSE_2_IN_GA1(x1)
IF_REVERSE_2_IN_2_GA5(x1, x2, x3, x4, x5)  =  IF_REVERSE_2_IN_2_GA1(x5)
QUERY_1_IN_G1(x1)  =  QUERY_1_IN_G1(x1)
APPEND_3_IN_GGA3(x1, x2, x3)  =  APPEND_3_IN_GGA2(x1, x2)
IF_REVERSE_2_IN_1_GA4(x1, x2, x3, x4)  =  IF_REVERSE_2_IN_1_GA1(x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph contains 3 SCCs with 8 less nodes.

↳ PROLOG
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

APPEND_3_IN_GGA3(cons_22(X, XS), YS, cons_22(X, ZS)) -> APPEND_3_IN_GGA3(XS, YS, ZS)

The TRS R consists of the following rules:

query_1_in_g1(XS) -> if_query_1_in_1_g2(XS, shuffle_2_in_ga2(cons_22(X, XS), YS))
shuffle_2_in_ga2(nil_0, nil_0) -> shuffle_2_out_ga2(nil_0, nil_0)
shuffle_2_in_ga2(cons_22(X, XS), cons_22(X, YS)) -> if_shuffle_2_in_1_ga4(X, XS, YS, reverse_2_in_ga2(XS, ZS))
reverse_2_in_ga2(nil_0, nil_0) -> reverse_2_out_ga2(nil_0, nil_0)
reverse_2_in_ga2(cons_22(X, nil_0), cons_22(X, nil_0)) -> reverse_2_out_ga2(cons_22(X, nil_0), cons_22(X, nil_0))
reverse_2_in_ga2(cons_22(X, XS), YS) -> if_reverse_2_in_1_ga4(X, XS, YS, reverse_2_in_ga2(XS, ZS))
if_reverse_2_in_1_ga4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> if_reverse_2_in_2_ga5(X, XS, YS, ZS, append_3_in_gga3(ZS, cons_22(X, nil_0), YS))
append_3_in_gga3(nil_0, XS, XS) -> append_3_out_gga3(nil_0, XS, XS)
append_3_in_gga3(cons_22(X, XS), YS, cons_22(X, ZS)) -> if_append_3_in_1_gga5(X, XS, YS, ZS, append_3_in_gga3(XS, YS, ZS))
if_append_3_in_1_gga5(X, XS, YS, ZS, append_3_out_gga3(XS, YS, ZS)) -> append_3_out_gga3(cons_22(X, XS), YS, cons_22(X, ZS))
if_reverse_2_in_2_ga5(X, XS, YS, ZS, append_3_out_gga3(ZS, cons_22(X, nil_0), YS)) -> reverse_2_out_ga2(cons_22(X, XS), YS)
if_shuffle_2_in_1_ga4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> if_shuffle_2_in_2_ga5(X, XS, YS, ZS, shuffle_2_in_ga2(ZS, YS))
if_shuffle_2_in_2_ga5(X, XS, YS, ZS, shuffle_2_out_ga2(ZS, YS)) -> shuffle_2_out_ga2(cons_22(X, XS), cons_22(X, YS))
if_query_1_in_1_g2(XS, shuffle_2_out_ga2(cons_22(X, XS), YS)) -> query_1_out_g1(XS)

The argument filtering Pi contains the following mapping:
query_1_in_g1(x1)  =  query_1_in_g1(x1)
nil_0  =  nil_0
cons_22(x1, x2)  =  cons_21(x2)
if_query_1_in_1_g2(x1, x2)  =  if_query_1_in_1_g1(x2)
shuffle_2_in_ga2(x1, x2)  =  shuffle_2_in_ga1(x1)
shuffle_2_out_ga2(x1, x2)  =  shuffle_2_out_ga1(x2)
if_shuffle_2_in_1_ga4(x1, x2, x3, x4)  =  if_shuffle_2_in_1_ga1(x4)
reverse_2_in_ga2(x1, x2)  =  reverse_2_in_ga1(x1)
reverse_2_out_ga2(x1, x2)  =  reverse_2_out_ga1(x2)
if_reverse_2_in_1_ga4(x1, x2, x3, x4)  =  if_reverse_2_in_1_ga1(x4)
if_reverse_2_in_2_ga5(x1, x2, x3, x4, x5)  =  if_reverse_2_in_2_ga1(x5)
append_3_in_gga3(x1, x2, x3)  =  append_3_in_gga2(x1, x2)
append_3_out_gga3(x1, x2, x3)  =  append_3_out_gga1(x3)
if_append_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_append_3_in_1_gga1(x5)
if_shuffle_2_in_2_ga5(x1, x2, x3, x4, x5)  =  if_shuffle_2_in_2_ga1(x5)
query_1_out_g1(x1)  =  query_1_out_g
APPEND_3_IN_GGA3(x1, x2, x3)  =  APPEND_3_IN_GGA2(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting we can delete all non-usable rules from R.

↳ PROLOG
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

APPEND_3_IN_GGA3(cons_22(X, XS), YS, cons_22(X, ZS)) -> APPEND_3_IN_GGA3(XS, YS, ZS)

R is empty.
The argument filtering Pi contains the following mapping:
cons_22(x1, x2)  =  cons_21(x2)
APPEND_3_IN_GGA3(x1, x2, x3)  =  APPEND_3_IN_GGA2(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem into ordinary QDP problem by application of Pi.

↳ PROLOG
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

APPEND_3_IN_GGA2(cons_21(XS), YS) -> APPEND_3_IN_GGA2(XS, YS)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
The head symbols of this DP problem are {APPEND_3_IN_GGA2}.
By using the subterm criterion together with the size-change analysis we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ PROLOG
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

REVERSE_2_IN_GA2(cons_22(X, XS), YS) -> REVERSE_2_IN_GA2(XS, ZS)

The TRS R consists of the following rules:

query_1_in_g1(XS) -> if_query_1_in_1_g2(XS, shuffle_2_in_ga2(cons_22(X, XS), YS))
shuffle_2_in_ga2(nil_0, nil_0) -> shuffle_2_out_ga2(nil_0, nil_0)
shuffle_2_in_ga2(cons_22(X, XS), cons_22(X, YS)) -> if_shuffle_2_in_1_ga4(X, XS, YS, reverse_2_in_ga2(XS, ZS))
reverse_2_in_ga2(nil_0, nil_0) -> reverse_2_out_ga2(nil_0, nil_0)
reverse_2_in_ga2(cons_22(X, nil_0), cons_22(X, nil_0)) -> reverse_2_out_ga2(cons_22(X, nil_0), cons_22(X, nil_0))
reverse_2_in_ga2(cons_22(X, XS), YS) -> if_reverse_2_in_1_ga4(X, XS, YS, reverse_2_in_ga2(XS, ZS))
if_reverse_2_in_1_ga4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> if_reverse_2_in_2_ga5(X, XS, YS, ZS, append_3_in_gga3(ZS, cons_22(X, nil_0), YS))
append_3_in_gga3(nil_0, XS, XS) -> append_3_out_gga3(nil_0, XS, XS)
append_3_in_gga3(cons_22(X, XS), YS, cons_22(X, ZS)) -> if_append_3_in_1_gga5(X, XS, YS, ZS, append_3_in_gga3(XS, YS, ZS))
if_append_3_in_1_gga5(X, XS, YS, ZS, append_3_out_gga3(XS, YS, ZS)) -> append_3_out_gga3(cons_22(X, XS), YS, cons_22(X, ZS))
if_reverse_2_in_2_ga5(X, XS, YS, ZS, append_3_out_gga3(ZS, cons_22(X, nil_0), YS)) -> reverse_2_out_ga2(cons_22(X, XS), YS)
if_shuffle_2_in_1_ga4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> if_shuffle_2_in_2_ga5(X, XS, YS, ZS, shuffle_2_in_ga2(ZS, YS))
if_shuffle_2_in_2_ga5(X, XS, YS, ZS, shuffle_2_out_ga2(ZS, YS)) -> shuffle_2_out_ga2(cons_22(X, XS), cons_22(X, YS))
if_query_1_in_1_g2(XS, shuffle_2_out_ga2(cons_22(X, XS), YS)) -> query_1_out_g1(XS)

The argument filtering Pi contains the following mapping:
query_1_in_g1(x1)  =  query_1_in_g1(x1)
nil_0  =  nil_0
cons_22(x1, x2)  =  cons_21(x2)
if_query_1_in_1_g2(x1, x2)  =  if_query_1_in_1_g1(x2)
shuffle_2_in_ga2(x1, x2)  =  shuffle_2_in_ga1(x1)
shuffle_2_out_ga2(x1, x2)  =  shuffle_2_out_ga1(x2)
if_shuffle_2_in_1_ga4(x1, x2, x3, x4)  =  if_shuffle_2_in_1_ga1(x4)
reverse_2_in_ga2(x1, x2)  =  reverse_2_in_ga1(x1)
reverse_2_out_ga2(x1, x2)  =  reverse_2_out_ga1(x2)
if_reverse_2_in_1_ga4(x1, x2, x3, x4)  =  if_reverse_2_in_1_ga1(x4)
if_reverse_2_in_2_ga5(x1, x2, x3, x4, x5)  =  if_reverse_2_in_2_ga1(x5)
append_3_in_gga3(x1, x2, x3)  =  append_3_in_gga2(x1, x2)
append_3_out_gga3(x1, x2, x3)  =  append_3_out_gga1(x3)
if_append_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_append_3_in_1_gga1(x5)
if_shuffle_2_in_2_ga5(x1, x2, x3, x4, x5)  =  if_shuffle_2_in_2_ga1(x5)
query_1_out_g1(x1)  =  query_1_out_g
REVERSE_2_IN_GA2(x1, x2)  =  REVERSE_2_IN_GA1(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting we can delete all non-usable rules from R.

↳ PROLOG
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

REVERSE_2_IN_GA2(cons_22(X, XS), YS) -> REVERSE_2_IN_GA2(XS, ZS)

R is empty.
The argument filtering Pi contains the following mapping:
cons_22(x1, x2)  =  cons_21(x2)
REVERSE_2_IN_GA2(x1, x2)  =  REVERSE_2_IN_GA1(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem into ordinary QDP problem by application of Pi.

↳ PROLOG
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

REVERSE_2_IN_GA1(cons_21(XS)) -> REVERSE_2_IN_GA1(XS)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
The head symbols of this DP problem are {REVERSE_2_IN_GA1}.
By using the subterm criterion together with the size-change analysis we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ PROLOG
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof

Pi DP problem:
The TRS P consists of the following rules:

SHUFFLE_2_IN_GA2(cons_22(X, XS), cons_22(X, YS)) -> IF_SHUFFLE_2_IN_1_GA4(X, XS, YS, reverse_2_in_ga2(XS, ZS))
IF_SHUFFLE_2_IN_1_GA4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> SHUFFLE_2_IN_GA2(ZS, YS)

The TRS R consists of the following rules:

query_1_in_g1(XS) -> if_query_1_in_1_g2(XS, shuffle_2_in_ga2(cons_22(X, XS), YS))
shuffle_2_in_ga2(nil_0, nil_0) -> shuffle_2_out_ga2(nil_0, nil_0)
shuffle_2_in_ga2(cons_22(X, XS), cons_22(X, YS)) -> if_shuffle_2_in_1_ga4(X, XS, YS, reverse_2_in_ga2(XS, ZS))
reverse_2_in_ga2(nil_0, nil_0) -> reverse_2_out_ga2(nil_0, nil_0)
reverse_2_in_ga2(cons_22(X, nil_0), cons_22(X, nil_0)) -> reverse_2_out_ga2(cons_22(X, nil_0), cons_22(X, nil_0))
reverse_2_in_ga2(cons_22(X, XS), YS) -> if_reverse_2_in_1_ga4(X, XS, YS, reverse_2_in_ga2(XS, ZS))
if_reverse_2_in_1_ga4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> if_reverse_2_in_2_ga5(X, XS, YS, ZS, append_3_in_gga3(ZS, cons_22(X, nil_0), YS))
append_3_in_gga3(nil_0, XS, XS) -> append_3_out_gga3(nil_0, XS, XS)
append_3_in_gga3(cons_22(X, XS), YS, cons_22(X, ZS)) -> if_append_3_in_1_gga5(X, XS, YS, ZS, append_3_in_gga3(XS, YS, ZS))
if_append_3_in_1_gga5(X, XS, YS, ZS, append_3_out_gga3(XS, YS, ZS)) -> append_3_out_gga3(cons_22(X, XS), YS, cons_22(X, ZS))
if_reverse_2_in_2_ga5(X, XS, YS, ZS, append_3_out_gga3(ZS, cons_22(X, nil_0), YS)) -> reverse_2_out_ga2(cons_22(X, XS), YS)
if_shuffle_2_in_1_ga4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> if_shuffle_2_in_2_ga5(X, XS, YS, ZS, shuffle_2_in_ga2(ZS, YS))
if_shuffle_2_in_2_ga5(X, XS, YS, ZS, shuffle_2_out_ga2(ZS, YS)) -> shuffle_2_out_ga2(cons_22(X, XS), cons_22(X, YS))
if_query_1_in_1_g2(XS, shuffle_2_out_ga2(cons_22(X, XS), YS)) -> query_1_out_g1(XS)

The argument filtering Pi contains the following mapping:
query_1_in_g1(x1)  =  query_1_in_g1(x1)
nil_0  =  nil_0
cons_22(x1, x2)  =  cons_21(x2)
if_query_1_in_1_g2(x1, x2)  =  if_query_1_in_1_g1(x2)
shuffle_2_in_ga2(x1, x2)  =  shuffle_2_in_ga1(x1)
shuffle_2_out_ga2(x1, x2)  =  shuffle_2_out_ga1(x2)
if_shuffle_2_in_1_ga4(x1, x2, x3, x4)  =  if_shuffle_2_in_1_ga1(x4)
reverse_2_in_ga2(x1, x2)  =  reverse_2_in_ga1(x1)
reverse_2_out_ga2(x1, x2)  =  reverse_2_out_ga1(x2)
if_reverse_2_in_1_ga4(x1, x2, x3, x4)  =  if_reverse_2_in_1_ga1(x4)
if_reverse_2_in_2_ga5(x1, x2, x3, x4, x5)  =  if_reverse_2_in_2_ga1(x5)
append_3_in_gga3(x1, x2, x3)  =  append_3_in_gga2(x1, x2)
append_3_out_gga3(x1, x2, x3)  =  append_3_out_gga1(x3)
if_append_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_append_3_in_1_gga1(x5)
if_shuffle_2_in_2_ga5(x1, x2, x3, x4, x5)  =  if_shuffle_2_in_2_ga1(x5)
query_1_out_g1(x1)  =  query_1_out_g
SHUFFLE_2_IN_GA2(x1, x2)  =  SHUFFLE_2_IN_GA1(x1)
IF_SHUFFLE_2_IN_1_GA4(x1, x2, x3, x4)  =  IF_SHUFFLE_2_IN_1_GA1(x4)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting we can delete all non-usable rules from R.

↳ PROLOG
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

SHUFFLE_2_IN_GA2(cons_22(X, XS), cons_22(X, YS)) -> IF_SHUFFLE_2_IN_1_GA4(X, XS, YS, reverse_2_in_ga2(XS, ZS))
IF_SHUFFLE_2_IN_1_GA4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> SHUFFLE_2_IN_GA2(ZS, YS)

The TRS R consists of the following rules:

reverse_2_in_ga2(nil_0, nil_0) -> reverse_2_out_ga2(nil_0, nil_0)
reverse_2_in_ga2(cons_22(X, nil_0), cons_22(X, nil_0)) -> reverse_2_out_ga2(cons_22(X, nil_0), cons_22(X, nil_0))
reverse_2_in_ga2(cons_22(X, XS), YS) -> if_reverse_2_in_1_ga4(X, XS, YS, reverse_2_in_ga2(XS, ZS))
if_reverse_2_in_1_ga4(X, XS, YS, reverse_2_out_ga2(XS, ZS)) -> if_reverse_2_in_2_ga5(X, XS, YS, ZS, append_3_in_gga3(ZS, cons_22(X, nil_0), YS))
if_reverse_2_in_2_ga5(X, XS, YS, ZS, append_3_out_gga3(ZS, cons_22(X, nil_0), YS)) -> reverse_2_out_ga2(cons_22(X, XS), YS)
append_3_in_gga3(nil_0, XS, XS) -> append_3_out_gga3(nil_0, XS, XS)
append_3_in_gga3(cons_22(X, XS), YS, cons_22(X, ZS)) -> if_append_3_in_1_gga5(X, XS, YS, ZS, append_3_in_gga3(XS, YS, ZS))
if_append_3_in_1_gga5(X, XS, YS, ZS, append_3_out_gga3(XS, YS, ZS)) -> append_3_out_gga3(cons_22(X, XS), YS, cons_22(X, ZS))

The argument filtering Pi contains the following mapping:
nil_0  =  nil_0
cons_22(x1, x2)  =  cons_21(x2)
reverse_2_in_ga2(x1, x2)  =  reverse_2_in_ga1(x1)
reverse_2_out_ga2(x1, x2)  =  reverse_2_out_ga1(x2)
if_reverse_2_in_1_ga4(x1, x2, x3, x4)  =  if_reverse_2_in_1_ga1(x4)
if_reverse_2_in_2_ga5(x1, x2, x3, x4, x5)  =  if_reverse_2_in_2_ga1(x5)
append_3_in_gga3(x1, x2, x3)  =  append_3_in_gga2(x1, x2)
append_3_out_gga3(x1, x2, x3)  =  append_3_out_gga1(x3)
if_append_3_in_1_gga5(x1, x2, x3, x4, x5)  =  if_append_3_in_1_gga1(x5)
SHUFFLE_2_IN_GA2(x1, x2)  =  SHUFFLE_2_IN_GA1(x1)
IF_SHUFFLE_2_IN_1_GA4(x1, x2, x3, x4)  =  IF_SHUFFLE_2_IN_1_GA1(x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem into ordinary QDP problem by application of Pi.

↳ PROLOG
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof

Q DP problem:
The TRS P consists of the following rules:

SHUFFLE_2_IN_GA1(cons_21(XS)) -> IF_SHUFFLE_2_IN_1_GA1(reverse_2_in_ga1(XS))
IF_SHUFFLE_2_IN_1_GA1(reverse_2_out_ga1(ZS)) -> SHUFFLE_2_IN_GA1(ZS)

The TRS R consists of the following rules:

reverse_2_in_ga1(nil_0) -> reverse_2_out_ga1(nil_0)
reverse_2_in_ga1(cons_21(nil_0)) -> reverse_2_out_ga1(cons_21(nil_0))
reverse_2_in_ga1(cons_21(XS)) -> if_reverse_2_in_1_ga1(reverse_2_in_ga1(XS))
if_reverse_2_in_1_ga1(reverse_2_out_ga1(ZS)) -> if_reverse_2_in_2_ga1(append_3_in_gga2(ZS, cons_21(nil_0)))
if_reverse_2_in_2_ga1(append_3_out_gga1(YS)) -> reverse_2_out_ga1(YS)
append_3_in_gga2(nil_0, XS) -> append_3_out_gga1(XS)
append_3_in_gga2(cons_21(XS), YS) -> if_append_3_in_1_gga1(append_3_in_gga2(XS, YS))
if_append_3_in_1_gga1(append_3_out_gga1(ZS)) -> append_3_out_gga1(cons_21(ZS))

The set Q consists of the following terms:

reverse_2_in_ga1(x0)
if_reverse_2_in_1_ga1(x0)
if_reverse_2_in_2_ga1(x0)
append_3_in_gga2(x0, x1)
if_append_3_in_1_gga1(x0)

We have to consider all (P,Q,R)-chains.
The head symbols of this DP problem are {IF_SHUFFLE_2_IN_1_GA1, SHUFFLE_2_IN_GA1}.
We used the following order together with the size-change analysis to show that there are no infinite chains for this DP problem.

Order:Polynomial interpretation:


POL(nil_0) = 0   
POL(append_3_out_gga1(x1)) = x1   
POL(cons_21(x1)) = 1 + x1   
POL(reverse_2_out_ga1(x1)) = x1   
POL(if_reverse_2_in_1_ga1(x1)) = 1 + x1   
POL(if_append_3_in_1_gga1(x1)) = 1 + x1   
POL(reverse_2_in_ga1(x1)) = x1   
POL(if_reverse_2_in_2_ga1(x1)) = x1   
POL(append_3_in_gga2(x1, x2)) = x1 + x2   

From the DPs we obtained the following set of size-change graphs:

We oriented the following set of usable rules.


reverse_2_in_ga1(nil_0) -> reverse_2_out_ga1(nil_0)
reverse_2_in_ga1(cons_21(XS)) -> if_reverse_2_in_1_ga1(reverse_2_in_ga1(XS))
reverse_2_in_ga1(cons_21(nil_0)) -> reverse_2_out_ga1(cons_21(nil_0))
if_reverse_2_in_2_ga1(append_3_out_gga1(YS)) -> reverse_2_out_ga1(YS)
if_reverse_2_in_1_ga1(reverse_2_out_ga1(ZS)) -> if_reverse_2_in_2_ga1(append_3_in_gga2(ZS, cons_21(nil_0)))
if_append_3_in_1_gga1(append_3_out_gga1(ZS)) -> append_3_out_gga1(cons_21(ZS))
append_3_in_gga2(nil_0, XS) -> append_3_out_gga1(XS)
append_3_in_gga2(cons_21(XS), YS) -> if_append_3_in_1_gga1(append_3_in_gga2(XS, YS))